//
//  LYSettingCell.m
//  SelectCity
//
//  Created by liuyan on 2019/3/23.
//  Copyright © 2019年 liuyan. All rights reserved.
//

#import "LYSettingCell.h"

@interface LYSettingCell()

@property (nonatomic, strong) UILabel *titlelabel;

@end


@implementation LYSettingCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initSubViews];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.height = 45;
    }
    return self;
}

#pragma mark - InitSubViews
- (void)initSubViews{
    self.titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, 120, 45)];
    self.titlelabel.font = Font(Font_15);
    self.titlelabel.textColor = RGB(34, 34, 34);
    [self.contentView addSubview:self.titlelabel];
    
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake( WIDTH - 18, 16.5, 6, 12)];
    imageView.image = [UIImage imageNamed:@"icon_open"];
    [self.contentView addSubview:imageView];
    
    self.detaillabel = [[UILabel alloc] initWithFrame:CGRectMake(self.titlelabel.right +5, 0, imageView.left - _titlelabel.right  - 20, 45)];
    self.detaillabel.font = Font(Font_12);;
    self.detaillabel.textColor = RGB(153, 153, 153);
    self.detaillabel.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:self.detaillabel];
    
    UIView *lineview = [[UIView alloc] initWithFrame:CGRectMake(0, 44.5, WIDTH, 0.5)];
    lineview.backgroundColor = RGB(247, 247, 247);
    [self.contentView addSubview:lineview];
}

#pragma mark -- Action
- (void)setTitle:(NSString *)title detail:(NSString *)detail{
    _titlelabel.text = title;
    _detaillabel.text = detail;
}

@end
